package NET.sourceforge.BplusJ.BplusJ;

import junit.framework.TestCase;

public class BplusTreeTest extends TestCase {
	String treefile = "d:/temp/b+test_tree.txt";
	String blockfile = "d:/temp/b+block.txt";
	String samplekey = "test";
	int nodesize = 128;
	int buffersize = 128;
//	int cultureid = 10;
	BplusTree bpt;
	public static int INVARIANTCULTUREID = 127;
	/*
	 * (non-Javadoc)
	 * 
	 * @see junit.framework.TestCase#setUp()
	 */
	@Override
	protected void setUp() throws Exception {
		super.setUp();
		bpt = BplusTree.Initialize(treefile, blockfile, samplekey.length(),
				INVARIANTCULTUREID, nodesize, buffersize);
		
	}

	public void testInsert() throws Exception{
		String key = "test";
		String val = "first try";
		bpt.set(key, val);
		bpt.Commit();
		
		System.out.println(bpt.get(key));
		assertEquals(bpt.get(key), val);
	}
}
